
#include "about_dialog.h"

#ifdef HAVE_CONFIG_H
  #include <config.h>
#endif


/* FIXME: Use gettext! */
#define _(a) (a)

void
show_about_dialog ()
{

  GtkWidget *dialog;
  GdkPixbuf *pixbuf;
  
  const gchar *authors [] = { "David Guglielmi <david.guglielmi@gmail.com>",\
                        "Nicolas-Pierre Cappellazzo <cappellazzonp@gmail.com>",\
                        NULL};
  
  dialog = gtk_about_dialog_new ();

  pixbuf = gtk_widget_render_icon (dialog,\
                                  GTK_STOCK_DIALOG_AUTHENTICATION,\
                                  GTK_ICON_SIZE_DIALOG,\
                                  NULL);

  gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (dialog), pixbuf);

  g_object_unref (pixbuf);
  
  gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (dialog), pixbuf);

  gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (dialog), authors);

#if (defined(PACKAGE_NAME) && defined(PACKAGE_VERSION))
  gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (dialog), PACKAGE_NAME);
  gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (dialog), PACKAGE_VERSION);
#else
  #error Unable to find PACKAGE_NAME or/and PACKAGE_VERSION, please define it !
#endif

  gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog),\
    "http://lympia.ouitech.net/");

  gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (dialog),\
    _("A Putty based Shell Manager for network administrator."));
    
  gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (dialog),\
    _("Copyright \xc2\xa9 2009 Ouitech Project"));

  gtk_window_set_transient_for (GTK_WINDOW (dialog),\
    GTK_WINDOW (gtk_window_list_toplevels ()->data));
  
  gtk_dialog_run (GTK_DIALOG (dialog));
  gtk_widget_destroy (dialog);

}

